﻿using System;

namespace TrinityCreator.Data
{
    public class ItemClass : IKeyValue
    {
        public ItemClass(int id, string description)
            : base(id, description) { }

        public ItemSubClass[] AvailableSubClasses
        {
            get
            {
                switch (Id)
                {
                    case 0:
                        return ItemSubClass.GetConsumableList();
                    case 1:
                        return ItemSubClass.GetContainerList();
                    case 2:
                        return ItemSubClass.GetWeaponList();
                    case 3:
                        return ItemSubClass.GetGemList();
                    case 4:
                        return ItemSubClass.GetArmorList();
                    case 5:
                        return ItemSubClass.GetReagentList();
                    case 6:
                        return ItemSubClass.GetProjectileList();
                    case 7:
                        return ItemSubClass.GetTradeGoodsList();
                    case 9:
                        return ItemSubClass.GetRecipeList();
                    case 11:
                        return ItemSubClass.GetQuiverList();
                    case 12:
                        return ItemSubClass.GetQuestList();
                    case 13:
                        return ItemSubClass.GetKeyList();
                    case 15:
                        return ItemSubClass.GetMiscellaneousList();
                    default:
                        throw new Exception("没有为该物品类型提供子类型选项.");
                }
            }
        }


        /// <summary>
        ///     Return list of supported itemclasses
        /// </summary>
        /// <returns></returns>
        public static ItemClass[] GetClassList()
        {
            return new[]
            {
                new ItemClass(0, "消耗品"),
                new ItemClass(1, "容器"),
                new ItemClass(2, "武器"),
                new ItemClass(3, "宝石"),
                new ItemClass(4, "护甲"),
                new ItemClass(5, "药剂"),
                new ItemClass(6, "弹药"),
                new ItemClass(7, "商业物品(材料)"),
                new ItemClass(9, "食谱"),
                new ItemClass(11, "箭袋"),
                new ItemClass(12, "任务物品"),
                new ItemClass(13, "钥匙"),
                new ItemClass(15, "其它杂物"),
                new ItemClass(16, "雕文")
            };
        }
    }
}